<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>D</title>
</head>
<body>
        <input type="button" value="算两个数运算结果" id="btn">
        <script>
            alert("两数运算的结果为:16*23=368" + '\n□此页面禁止继续显示对话框。');
    
            document.getElementById('btn').onclick = function () {
                let num1 = prompt("请输入第一个数");
                let num2 = prompt("请输入第二个数");
                let op = prompt("请输入运算符")
                let n1 = parseFloat(num1);
                let n2 = parseFloat(num2);
                let a;
                if (op === '+') {
                    a = n1 + n2;
                } else if (op === '-') {
                    a = n1 - n2;
                } else if (op === '*') {
                   a = n1 * n2;
                } else if (op === '/') {
                    a = n2 !== 0 ? n1 / n2 : '除数不能为 0';
                } else {
                    a = "你输入的运算符不对，请输入正确的运算符(+,-,*,/)！！！";
                }
                document.write('运算结果为：' + a);
            };
        </script>
    </body>
    
    <html>
       
       
    </script>
</body>
</html>